package com.zy.je.common.core.aspect;

import com.zy.je.common.core.annotation.ApiLog;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;

/**
 * @author zy
 */
@Slf4j
@Aspect
public class ApiLogAspect {

	@Around("@annotation(apiLog)")
	@SneakyThrows
	public Object around(ProceedingJoinPoint point, ApiLog apiLog) {
		String strClassName = point.getTarget().getClass().getName();
		String strMethodName = point.getSignature().getName();
		log.debug("web请求类名:[{}],方法:[{}]", strClassName, strMethodName);
		return point.proceed();
	}
}
